#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtConcurrent/QtConcurrent>
#include <QFuture>
#include <QFutureWatcher>
#include "manager.h"
#include "renderer.h"


typedef unsigned int uint;

namespace Ui {
class MainWindow;
}

class Renderer;
class Manager;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    Manager                     *m_Manager;

    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_pushButton_clicked();
    void FrameRendered();

    void on_pushButton_2_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

private:
    Ui::MainWindow              *ui;
    bool                        m_Rendering;
    Renderer                    *m_Renderer;
    void                        RenderFrame();
    QFuture<void>               *m_Future;
    QFutureWatcher<void>        *m_Watcher;
    void                        CountFPS();
    void                        UpdateInfos();

    DWORD                       dwFrames;
    DWORD                       dwCurrentTime;
    DWORD                       dwLastUpdateTime;
    DWORD                       dwElapsedTime;
    TCHAR                       szFPS[32];
    int                         m_Iterator;

};

#endif // MAINWINDOW_H
